package com.education.welco.service.impl;

import java.util.List;

import com.education.common.utils.Convert;
import com.education.welco.mapper.SCatalogResourceSynMapper;
import com.education.welco.pojo.SCatalogResourceSyn;
import com.education.welco.service.ISCatalogResourceSynService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 备课查看资源 服务层实现
 *
 * @author d
 * @date 2020-05-14
 */
@Service
public class SCatalogResourceSynServiceImpl implements ISCatalogResourceSynService {

    @Autowired
    private SCatalogResourceSynMapper sCatalogResourceSynMapper;

    /**
     * 查询备课查看资源信息
     *
     * @param id 备课查看资源ID
     * @return 备课查看资源信息
     */
    @Override
    public SCatalogResourceSyn selectSCatalogResourceSynById(Integer id) {
        return sCatalogResourceSynMapper.selectSCatalogResourceSynById(id);
    }

    /**
     * 查询备课查看资源列表
     *
     * @param sCatalogResourceSyn 备课查看资源信息
     * @return 备课查看资源集合
     */
    @Override
    public List<SCatalogResourceSyn> selectSCatalogResourceSynList(SCatalogResourceSyn sCatalogResourceSyn) {
        return sCatalogResourceSynMapper.selectSCatalogResourceSynList(sCatalogResourceSyn);
    }

    /**
     * 新增备课查看资源
     *
     * @param sCatalogResourceSyn 备课查看资源信息
     * @return 结果
     */
    @Override
    public int insertSCatalogResourceSyn(SCatalogResourceSyn sCatalogResourceSyn) {
        return sCatalogResourceSynMapper.insertSCatalogResourceSyn(sCatalogResourceSyn);
    }

    @Override
    public int deleteSCatalogResourceSynByTypeAndcatalogId(SCatalogResourceSyn sCatalogResourceSyn) {
        return sCatalogResourceSynMapper.deleteSCatalogResourceSynByTypeAndcatalogId(sCatalogResourceSyn);
    }

    /**
     * 修改备课查看资源
     *
     * @param sCatalogResourceSyn 备课查看资源信息
     * @return 结果
     */
    @Override
    public int updateSCatalogResourceSyn(SCatalogResourceSyn sCatalogResourceSyn) {
        return sCatalogResourceSynMapper.updateSCatalogResourceSyn(sCatalogResourceSyn);
    }

    /**
     * 删除备课查看资源对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSCatalogResourceSynByIds(String ids) {
        return sCatalogResourceSynMapper.deleteSCatalogResourceSynByIds(Convert.toStrArray(ids));
    }
}